package com.atguigu.day03;

import org.apache.flink.api.common.RuntimeExecutionMode;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author Felix
 * @date 2024/4/1
 * 该案例演示了执行模式
 */
public class Flink02_Exe_M {
    public static void main(String[] args) throws Exception {
        //TODO 指定流处理环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        //执行运行模式
        env.setRuntimeMode(RuntimeExecutionMode.BATCH);
        //TODO 从指定的文件中读取数据
        DataStreamSource<String> wordDS = env.readTextFile("/opt/module/flink-1.17.0/word.txt");

        wordDS.print();

        env.execute();
    }
}
